import 'package:flutter/material.dart';
import 'package:flutterroom/pages/home/info/info_item_wdiget.dart';
import 'data.dart';

class Info extends StatelessWidget {
  final bool showTitle;
  final List<InfoItem> dataList;

  const Info({Key key, this.showTitle = false, this.dataList=infoData})
      : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        children: <Widget>[
          if(showTitle)Container(
            alignment: Alignment.centerLeft,
            padding: EdgeInsets.only(top: 10,left: 10,bottom: 6),
            child: Text("最新资讯",style: TextStyle(color: Colors.black ,fontWeight: FontWeight.w500),),
          ),
          Column(
            children: dataList
                .map((item) => InfoItemWidget(item))
                .toList(),
          )
        ],
      ),
    );
  }
}
